import 'package:share_fit/app/controllers/base/base_controller.dart';
import 'package:share_fit/app/controllers/device/remind/picker/model/pduration.dart';
import 'package:share_fit/app/controllers/device/remind/remind_item.dart';
import 'package:share_fit/app/controllers/device/remind/remind_state.dart';

class RemindLogic extends BaseController {

  final RemindState state = RemindState();

  void setNotes(String value) {
    state.notes = value;
    update(['remind_notes']);
  }

  void addItem(RemindItem item) {
    state.itemDatas.insert(0, item);
    update(['update_datas']);
  }

  void setStartDate(PDuration p) {
    state.startDate = p;
    // update(['update_pduration']);
  }

  void setEndDate(PDuration p) {
    state.endDate = p;
    // update(['update_pduration']);
  }

  void setStartTime(PDuration p) {
    state.startDate.hour = p.hour;
    state.startDate.minute = p.minute;
    update(['update_start_pduration']);
  }

  void setEndTime(PDuration p) {
    state.endDate.hour = p.hour;
    state.endDate.minute = p.minute;
    update(['update_end_pduration']);
  }

  void setCommitText(String value) {
    state.commitText = value;
    update(['update_commit_text']);
  }

  void setTitleText(String value) {
    state.titleText = value;
    update(['update_title_text']);
  }

  @override
  String getRemotePath() {
    return "";
  }

  @override
  void initState() {
    // TODO: implement initState
  }

  @override
  void onRemoteEvent(event, method) {
    // TODO: implement onRemoteEvent
  }

}